import request from '@/config/axios'

// 信息源注册配置信息 VO
export interface DataSourceRegisterConfigVO {
  id: number // 主键
  address: string // 注册地址
  license: string // 许可证号
  owner: string // 所属机构
  type: string // 终端类型
  scope: string // 授权范围
  sourceId: number // 信息源ID
}

// 信息源注册配置信息 API
export const DataSourceRegisterConfigApi = {
  // 查询信息源注册配置信息分页
  getDataSourceRegisterConfigPage: async (params: any) => {
    return await request.get({ url: `/forward/data-source-register-config/page`, params })
  },

  // 查询信息源注册配置信息详情
  getDataSourceRegisterConfig: async (id: number) => {
    return await request.get({ url: `/forward/data-source-register-config/get?id=` + id })
  },

  // 新增信息源注册配置信息
  createDataSourceRegisterConfig: async (data: DataSourceRegisterConfigVO) => {
    return await request.post({ url: `/forward/data-source-register-config/create`, data })
  },

  // 修改信息源注册配置信息
  updateDataSourceRegisterConfig: async (data: DataSourceRegisterConfigVO) => {
    return await request.put({ url: `/forward/data-source-register-config/update`, data })
  },

  // 删除信息源注册配置信息
  deleteDataSourceRegisterConfig: async (id: number) => {
    return await request.delete({ url: `/forward/data-source-register-config/delete?id=` + id })
  },

  // 导出信息源注册配置信息 Excel
  exportDataSourceRegisterConfig: async (params) => {
    return await request.download({ url: `/forward/data-source-register-config/export-excel`, params })
  },

  // 查询信息源注册配置信息详情
  getDataSourceRegisterConfigBySourceId: async (sourceId: number) => {
    return await request.get({ url: `/forward/data-source-register-config/select?sourceId=` + sourceId })
  },
}
